package com.codetotem.app.home.ilibrary.services;

import com.codetotem.app.home.ilibrary.bean.*;
import java.util.ArrayList;

public class BasicService {
	
	/**
	 * Search the docs in the loa
	 * 
	 * @return
	 */
	public String searchDocument(Object libObj,SearchCondition[] conditions){
		
		String result = "";
		
		//1. get all conditions for the search
		
		for(int i = 0; i <conditions.length; i ++)
		{
			SearchCondition condition = conditions[i];
			
			String sql_condition = "";
			
			String the_condition = condition.getKeyword()+" " + condition.getCompare()+" "+condition.getCondition();
			
			if(i==0){
				sql_condition = condition.getKeyword()+" " + condition.getCompare()+" "+condition.getCondition();
			}else if (i>0)
			{
				sql_condition = sql_condition + " and " + the_condition;
			}
		}
		
		
		
		
		
		return result;
	}
	
	public void setFavorityBook()
	{
		
	}

}
